package com.lishe.lishe.lishe.module.excitation.activity;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.lishe.lishe.R;
import com.lishe.lishe.lishe.MyRecyclerView.TimeLineDecoration;
import com.lishe.lishe.lishe.base.BaseActivity;
import com.lishe.lishe.lishe.module.excitation.adapter.TimePathAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by shino on 2017/11/28.
 */

public class UserCompanyActivity extends BaseActivity implements View.OnClickListener {

    private RecyclerView recyclerView;
    private TextView title;
    private Button callBack;
    private List<String> content = new ArrayList<>();
    private TimePathAdapter adapter;


    public static void jump(Activity activity) {
        Intent intent = new Intent(activity, UserCompanyActivity.class);
        activity.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_welfare_order_status);
        initView();
    }

    private void initView() {
        for (int i = 0; i < 10; i++) {
            content.add("时间" + i);
        }
        title = findViewById(R.id.title_text_title);
        title.setText("所属企业");
        callBack = findViewById(R.id.title_left_button);
        recyclerView = findViewById(R.id.recyclerview);
        recyclerView.setLayoutManager(new StaggeredGridLayoutManager(1, StaggeredGridLayoutManager.VERTICAL));
        TimeLineDecoration mItemDecoration = new TimeLineDecoration
                .Builder(this)
                .setItemStyle(TimeLineDecoration.STYLE_RESOURCE)//选择dot使用图片资源或者用canvas画
//                .setImageResourse(R.mipmap.time_line_point)
                .setTopDistance(20)//单位dp
                .setItemInterVal(10)//单位dp
                .setItemPaddingLeft(10)//如果不设置，默认和item间距一样
                .setItemPaddingRight(10)//如果不设置，默认和item间距一样
                .setDotColor(Color.GRAY)
                .setDotRadius(4)//单位dp小圆半径
//                .setDotPaddingTop(0)
//                .setDotInItemOrientationCenter(false)//设置dot居中
                .setLineColor(Color.RED)//设置线的颜色
                .setLineWidth(1)//单位dp
                .setEndText("END")//设置结束的文字
                .setTextColor(Color.WHITE)
                .setTextSize(10)//单位sp
                .setDotPaddingText(2)//单位dp.设置最后一个点和文字之间的距离
                .setBottomDistance(0)//设置底部距离，可以延长底部线的长度
                .setCicleImageResourse(R.mipmap.time_line_point, 0)
//                .setImageResourse(R.mipmap.point_selected)
                .create();
        recyclerView.addItemDecoration(mItemDecoration);
        recyclerView.setAdapter(adapter);
        callBack.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.title_left_button:
                finish();
                break;
        }
    }
}
